import service from "@/api/index.js";

const orderApi = {
    getList(condition, pageNum, pageSize) {
        condition.pageNum = pageNum
        condition.pageSize = pageSize
        return service.get('/order',{params:condition})
    },
    getAll(condition) {
        return service.get('/order/List/all',condition)
    },
//     查询单条订单信息
    getInfoById(id) {
        return service.get(`/order/${id}`)
    },
//     发货
    sendGoods(id) {
        return service.put(`/order/${id}`)
    },
//     生成订单
    addInfo(orderVo) {
        return service.post('/order',orderVo)
    },
//     支付方法
    pay(orderId,payPassword) {
        return service.post('/order/pay',{orderId,payPassword},{
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
//     获得图表信息
    getInfoForEcharts() {
        return service.get('/order/Echarts')
    },
//     更新订单信息
    updateInfo(order) {
        return service.put('/order/update',order)
    }
}

export default orderApi;